package com.it.sun.learning001;

import com.it.sun.learning001.base.Car;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @ClassName com.it.sun.learning001.Lesson001
 * @Author sunmannian
 * @Date 2021/1/25 16:41
 * @Version V1.0
 * Description  <请输入一句话描述该类功能>
 * Copyright (C) 北京中电兴发科技有限公司  since 2021/1/25
 */
public class Lesson001 {
	public static void main(String[] args) {
		String basePackage = "com.it.sun.learning001";
		AnnotationConfigApplicationContext applicationContext =
				new AnnotationConfigApplicationContext(basePackage);
		Car car = applicationContext.getBean(Car.class);
		System.err.println("color is =>> " + car.getColor());
		System.err.println("capacity is =>> " + car.getCapacity());
		car.drive();
//		 关闭IOC容器
		applicationContext.close();
	}
}



